let fs = require('fs')

let p = new Promise((resolve, reject) => {
    fs.readFile('./resources/为学.md', (err, data)=>{
        //如果没有出错, 则输出内容
        resolve(data)
    });
})

p.then(value=>{
    return new Promise(resolve => {
        fs.readFile('./resources/插秧诗.md', (err, data)=>{
            //如果没有出错, 则输出内容
            resolve([value,data])
        });
    })
})
    .then(value => {
    return new Promise(resolve => {
        fs.readFile('./resources/观书有感.md', (err, data)=>{
            //如果没有出错, 则输出内容
            value.push(data)
            resolve(value)
        });
    })
}).
then(value => {
    console.log(value.join('\r\n'))
})